package test1;

class MyThread extends Thread{
    @Override
    public void run() {
        while (true) {
            System.out.println("hello t");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}

public class demo2 {
    public static void main(String[] args){
        Thread thread=new MyThread();
        /*thread.start();*/
        thread.run();
    }

}
